<!-- #57047 空白的注册页，设备会在注册页拼接上参数，用户进入到这个页面后(先登录)，把参数传给后端，后端返回成功后自动跳转会员中心
 -->
<template>
  <div>
    <!-- 骨架屏 -->
    <van-skeleton title avatar :row="3" />
  </div>
</template>

<script>
export default {
  data () {
    return {
    };
  },

  activated() {
    if(!this.$route.query.order_id) {
      this.$dialog.alert({
        title: '提示',
        message: '缺少参数order_id',
      }).then(() => {
        // on close
      });
      return;
    }
    this.bindOrder();
  },

  components: {},

  computed: {},

  mounted() {

  },

  methods: {
    async bindOrder() {
      let _json = {};
      //获取this.$route.query上的参数
      for (let i in this.$route.query) {
        if (this.$route.query[i] != "") {
          _json[i] = this.$route.query[i];
        }
      }
      let { result, msg, data } = await $http.get('plugin.xz-api.frontend.order.bind-order',_json,".");
      this.$dialog.alert({
        title: '提示',
        message: msg,
      }).then(() => {
        this.$router.push(this.fun.getUrl("member"));
      });
    }
  }
}

</script>
<style lang='scss' rel='stylesheet/scss' scoped>
</style>